/********************************************************************
	created:	2008/09/29
	created:	29:9:2008   22:07
	filename: 	h:\SimoneEngine\qianye\src\qylib\filesys\qyFile.h
	author:		Xiong Jiayu
	copyright:  
	purpose:	
*********************************************************************/

#pragma once

#ifndef __QYFILE_H__
#define __QYFILE_H__

#include "../common/qyCommon.h"
#include "../memsys/qyString.h"
#include "../memsys/qyAutoPtr.h"

class qyFile
{
public:
								qyFile();
								qyFile( const qyString &filename );
	virtual						~qyFile();

	//-----------------------------------------------------------------------
	/**
	*/
	const qyString &			GetFileName() const { return m_filename; }
	
	//-----------------------------------------------------------------------
	/**
	*/
	/*
	const char *				GetFilePath() const;
	const char *				SetFilePath( const char * );
	*/

	//-----------------------------------------------------------------------
	/**
	*/
	void *						AllockMemChunk( size_t memSizeByByte );
	void *						GetMemChunk( void );
	void						FreeMemChunk();
	size_t						GetChunkSizeByByte( void ) const;
protected:
	qyString					m_filename;
	qyString					m_absolutePath;
	void						*m_pMemChunk;
	size_t						m_sizeChunkByByte;
};

typedef std::auto_ptr<qyFile>	qyFilePtr;

#endif
